# 新增数据库模型定义（若不存在）
from flask_sqlalchemy import SQLAlchemy

db = SQLAlchemy()

class Attraction(db.Model):
    __tablename__ = 'table1'  # 同步用户要求的表名配置
    id = db.Column(db.Integer, primary_key=True)
    attraction_name = db.Column(db.String(255), name='attraction_name', nullable=False)
    e_name = db.Column(db.String(100))
    category = db.Column(db.String(50), name='category', index=True)
    budget = db.Column(db.Numeric(10,4), name='budget')
    longitude = db.Column(db.Numeric(10,4))
    latitude = db.Column(db.Numeric(10,4))
    time_hour = db.Column(db.Integer, name='time_hour')
    tssm = db.Column(db.String(255), name='tssm')
    popularity = db.Column(db.Integer, default=0)
    opening_hours = db.Column(db.String(100))
    description = db.Column(db.Text)